
function TabView(options)
{
	var defaults={
			op_selecter:"",
			show_selecter:"",
			auto_change_time:-1,
			active_class:"",
			defoult_index:0,
			op:"click"
		};
	var me = this;
	me.ops = $.extend(defaults,options);
	me.timer = null;
	me.current_index = 0;
	me.moveNext = function(){
		var mo_count = $(me.ops.op_selecter).size();
		me.current_index = me.current_index + 1;
		if(me.current_index >= mo_count)
		{
			me.current_index = 0;
		}
		$(me.ops.op_selecter + ":eq(" + me.current_index + ")").trigger(me.ops.op);
	}
	
	$(me.ops.op_selecter)[me.ops.op](function(){
		me.current_index = $(this).index();
		
		var e =$(me.ops.show_selecter + ":eq(" + me.current_index + ")");
		if(e && e.length > 0){
			e.show().siblings(me.ops.show_selecter + ":visible").hide();
		}
		
		if(me.ops.active_class)
		{
			if(!$(this).hasClass(me.ops.active_class))
			{
				$(this).addClass(me.ops.active_class);
			}
			$(this).siblings("." + me.ops.active_class).removeClass(me.ops.active_class);
		}
		if(me.timer)
		{
			clearInterval(me.timer);
			me.timer = setInterval((function(){
				me.moveNext();
			}), me.ops.auto_change_time);
		}
	});
	
	if(me.ops.auto_change_time > 0)
	{
		me.timer = setInterval((function(){
				me.moveNext();
			}), me.ops.auto_change_time);
	}
	$(me.ops.op_selecter + ":eq(" + me.ops.defoult_index + ")").trigger(me.ops.op);
}

$(document).ready(function(){
	/*
	new TabView({
			op_selecter:".ce_si_min li", //触发元素
			show_selecter:".ce_si_max img", //显示的元素
			active_class:"on", //当前触发元素class
			defoult_index:0, //默认位置
			auto_change_time:-1, //自动切换时间，毫秒 >0 表示自动切换
			op:"mouseenter"  //触发的条件  click 点击，mouseenter 鼠标进入
			});
			*/
	//开始
		new TabView({
				op_selecter:".tabs li",
				show_selecter:".tab_con",
				active_class:"thistab",
				op:"click"});
				
});

		
